/*
 * User: Sebastian Schuth <sebastian.schuth@agimatec.de>
 * Date: 29.10.2008
 * Time: 12:05:39
 * Copyright (c) 2008 agimatec GmbH
 */
package com.agimatec.locators.predicate;

/**
 * LocatorPart used to match nodes with a given value inside their "id" attribute.
 */
public class Id extends Predicate {
    private String id;

    /**
     * Constructor.
     * @param id The exact value teh id attribute must have to match this predicate. 
     */
    public Id(String id) {
        this.id=id;
    }

    public String getCssPredicate() {
        return "#"+this.id;
    }

    public String locatorPartString(LocatorStringFactory factory) {
        return factory.getIdPredicate(id).locatorString();
    }
}
